<script>
        $(function () {
            $.post("/getUserName",function (obj) {
                console.log("进入头部方法");
                var li = '';
                if (obj!=null&&obj!=100){
                    li = '欢迎用户' + obj.username + "登录" +
                    '<a href="exit" class="exit">&nbsp&nbsp&nbspExit</a>';
                    console.log(obj.username);
                }else {
                    li = '<a href="loginHtml" class="login">Login</a>\n' +
                        '    <a href="registerHtml" class="register">&nbsp&nbsp&nbspRegister</a>';
                }
                $("#header-login").html(li)
            },"json")
        })
    </script>
<header class="lyear-layout-header" id="header">

    <nav class="navbar navbar-default">
        <div class="topbar">

            <div class="topbar-left">
                <div class="lyear-aside-toggler">
                    <span class="lyear-toggler-bar"></span>
                    <span class="lyear-toggler-bar"></span>
                    <span class="lyear-toggler-bar"></span>
                </div>
                <span class="navbar-page-title"> Hello!Welcome~ </span>
            </div>
            <div class="header-login" id="header-login">
                <a href="loginHtml" class="login">Login</a>
                <a href="#" class="login">Exit</a>
            </div>
        </div>
    </nav>
</header>